﻿<sdk:Page 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:ViewModels="clr-namespace:AR.ViewModel.Candidat"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" 
           xmlns:Entities="clr-namespace:AR.Entities" xmlns:Services="clr-namespace:AR.Web.Services"
           xmlns:ct="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
           xmlns:behaviors="clr-namespace:Behavior"
           x:Class="AR.Views.Candidat.CreationCandidat"
            xmlns:local="clr-namespace:AR.Views"
           mc:Ignorable="d"
                 d:DesignWidth="640" d:DesignHeight="950"                
           Title="CreationCandidat Page">
    <!--<navigation:Page.Resources>
        <Converters:DateTimeToTimeSpanConverter x:Key="dateTimeToTimeSpanConverter"/>
    </navigation:Page.Resources>-->
    <Grid x:Name="LayoutRoot"  BindingValidationError="LayoutRoot_BindingValidationError" Height="993" VerticalAlignment="Top" Margin="0,0,0,-43">
        <Grid.RowDefinitions>
            <RowDefinition Height="0"/>
            <RowDefinition Height="152*"/>
            <RowDefinition Height="9*"/>
            <RowDefinition Height="10*"/>
        </Grid.RowDefinitions>
        <sdk:Label Content="" FontSize="30" FontWeight="ExtraBold" Foreground="{StaticResource AtosBlue}" VerticalAlignment="Top"/>

        <toolkit:Separator VerticalAlignment="Bottom"  Foreground="{StaticResource AtosBlue}" Background="{StaticResource AtosBlue}" Margin="32,0,2,2" />

        <Grid x:Name="MainGrid" Grid.Row="1" Margin="0,0,0,0" Grid.RowSpan="2" Height="817" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="129*"/>
                <ColumnDefinition Width="0*"/>
                <ColumnDefinition Width="130*"/>
                <ColumnDefinition Width="14*"/>
                <ColumnDefinition Width="40*"/>
                <ColumnDefinition Width="129*"/>
                <ColumnDefinition Width="100*"/>
                <ColumnDefinition Width="100*"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="29*"/>
                <RowDefinition Height="27*"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="27*"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="30*"/>
                <RowDefinition Height="0"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="48*" MinHeight="48"/>
                <RowDefinition Height="7*"/>
                <RowDefinition Height="27*"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="27*"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="30*"/>
                <RowDefinition Height="13*"/>
                <RowDefinition Height="48*" MinHeight="48"/>
                <RowDefinition Height="7*"/>
                <RowDefinition Height="27*"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="27*"/>
                <RowDefinition Height="13*"/>
                <RowDefinition Height="30*"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="30*"/>
                <RowDefinition Height="13*"/>
                <RowDefinition Height="29*"/>
                <RowDefinition Height="12*"/>
                <RowDefinition Height="30*"/>
                <RowDefinition Height="13*"/>
                <RowDefinition Height="27*"/>
                <RowDefinition MinHeight="100" Height="100*"/>
                <RowDefinition MinHeight="55" />
                <RowDefinition Height="32"/>

            </Grid.RowDefinitions>
            <sdk:Label Style="{StaticResource FormLabelStyle}" Content="Informations personnelles" Grid.ColumnSpan="3" FontSize="15" FontWeight="Bold" Foreground="{StaticResource AtosBlue}" VerticalAlignment="Bottom" Height="22" Margin="0,0,0,7" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="1" Content="Nom(*)" Margin="40,1,113,0" Height="16" Grid.ColumnSpan="3"/>
            <TextBox Grid.Column="2" Grid.Row="1" x:Name="txtNom"  Text="{Binding CandidatClient.NOM, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"   />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="1" Grid.Column="5" Content="Prénom(*)" Margin="0,0,42,0" Height="16"/>
            <TextBox Grid.Row="1" x:Name="txtPrenom"  Grid.Column="6" Text="{Binding CandidatClient.PRENOM, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="3" Content="Date de naissance(*)" Margin="40,0,118,0" Height="16" Grid.ColumnSpan="3"/>
            <sdk:DatePicker Grid.Row="3" Grid.Column="2" Text="{Binding Path=Candidat.DATENAISSANCE,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, StringFormat='{}{0:dd/MM/yyyy}'}" Margin="0,0,28,0" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="14" Grid.Column="5" Content="Niveau Expérience(*)" Margin="0,0,7,0" Height="16"/>
            <ComboBox Grid.Row="14" Grid.Column="6" ItemsSource="{Binding NiveauxExperience}"  DisplayMemberPath="INTITULE" SelectedValuePath="ID_EXPERIENCE" SelectedValue="{Binding Candidat.ID_EXPERIENCE, Mode=TwoWay}"  Margin="0,1,0,9" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="5" Content="Téléphone(*)" Margin="40,0,113,0" Height="16" Grid.ColumnSpan="3"/>
            <TextBox Grid.Row="5" Grid.Column="2" Text="{Binding CandidatClient.TEL, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"/>
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="3" Grid.Column="5" Content="Email(*)" Margin="0,0,42,0" Height="16"/>
            <TextBox Grid.Row="3" Grid.Column="6" Text="{Binding CandidatClient.EMAIL, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnExceptions=True}"/>

            <toolkit:Separator Grid.Row="8" Grid.ColumnSpan="8" VerticalAlignment="Top" Foreground="{StaticResource AtosBlue}" Background="{StaticResource AtosBlue}" Margin="32,2,2,0" Height="1" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Content="Informations professionnelles" Grid.Row="8" Grid.ColumnSpan="3" FontSize="15" FontWeight="Bold" Foreground="{StaticResource AtosBlue}" VerticalAlignment="Top" Margin="0,10,0,0" Height="22" />

            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="10" Content="Dernier employeur" Margin="40,0,0,0" Height="16"/>
            <TextBox Grid.Row="10" Grid.Column="2" Text="{Binding CandidatClient.DERNIER_EMPLOYEUR, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"/>
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="10" Grid.Column="5" Content="Préavis(nb jours)" Margin="0,1,24,0" Height="16"/>
            <TextBox Grid.Row="10" Grid.Column="6" Text="{Binding CandidatClient.PREAVIS, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"/>
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="12" Content="Salaire demandé" Margin="40,4,0,0" Height="16"/>
            <TextBox Grid.Row="12"  Grid.Column="2" Text="{Binding CandidatClient.SALAIRE_DEMANDE, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"/>
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="12" Grid.Column="5" Content="Salaire actuel" Margin="0,1,42,0" Height="16"/>
            <TextBox Grid.Row="12" Grid.Column="6" Text="{Binding CandidatClient.SALAIRE_ACTUELLE, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"/>

            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="14" Content="CV(*)" Margin="40,3,63,0" Height="16"/>
            <TextBox Grid.Row="14" x:Name="txtAddCv" IsReadOnly="{Binding CvPathReadOnly}" Text="{Binding CandidatClient.CvPath}"  Margin="0,0,44,0" Grid.Column="2" />
            <Button Content="..." Grid.Column="2" Grid.Row="14" HorizontalAlignment="Right" Width="44" Command="{Binding ParcourirClickCommand}"/>
            <toolkit:Separator Grid.Row="16" Grid.ColumnSpan="8" VerticalAlignment="Top" Foreground="{StaticResource AtosBlue}" Background="{StaticResource AtosBlue}" Margin="32,2,2,0" Height="1" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Content="Informations ATOS" Grid.Row="16" Grid.ColumnSpan="3" FontSize="15" FontWeight="Bold" Foreground="{StaticResource AtosBlue}" VerticalAlignment="Top" Margin="0,10,0,0" Height="22" />

            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.RowSpan="2" Grid.Row="18" Content="Date entretien technique" Margin="40,0,4,0" Height="16"/>
            <local:DateTimePicker Grid.Row="18" Grid.Column="2" x:Name="MyDateTimePickerTec" SelectedDateTime="{Binding Candidat.DATE_ENTRETIEN_TECHNIQUE, Mode=TwoWay, StringFormat='{}{0:dd/MM/yyyy HH:mm}'}" Grid.ColumnSpan="3" Margin="0,0,27,0" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="18" Grid.Column="5" Content="Date entretien RH" Margin="0,0,7,0" Height="16"/>
            <local:DateTimePicker  Grid.Row="18" Grid.Column="6" x:Name="MyDateTimePickerRH" SelectedDateTime="{Binding Candidat.DATE_ENTRETIEN_RH, Mode=TwoWay, StringFormat='{}{0:dd/MM/yyyy HH:mm}'}" Grid.ColumnSpan="2" Margin="0,0,10,0" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.RowSpan="2" Grid.Row="20" Content="Date Test technique" Margin="40,0,4,0" Height="16"/>
            <local:DateTimePicker Grid.Row="20" Grid.Column="2" x:Name="MyDateTimePickerTTec" SelectedDateTime="{Binding Candidat.DATE_TEST_TECHNIQUE, Mode=TwoWay, StringFormat='{}{0:dd/MM/yyyy HH:mm}'}" Grid.ColumnSpan="3" Margin="0,0,27,0" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="20" Grid.Column="5" Content="Date Intégration" Margin="0,0,7,0" Height="16"/>
            <local:DateTimePicker  Grid.Row="20" Grid.Column="6" x:Name="MyDateTimePickerint" SelectedDateTime="{Binding Candidat.DATE_INTEGRATION, Mode=TwoWay, StringFormat='{}{0:dd/MM/yyyy HH:mm}'}" Grid.ColumnSpan="2" Margin="0,0,10,0" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="22" Content="Practice(*)" Margin="40,0,0,0" Height="16"/>
            <ComboBox Grid.Row="22" Grid.Column="2" Margin="1,0,27,10" ItemsSource="{Binding Practices}" DisplayMemberPath="PRACTICE1" SelectedValuePath="ID_PRACTICE" SelectedValue="{Binding CandidatClient.IdPractice, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding Practice, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="22" Grid.Column="5"  Content="Poste(*)" Margin="0,0,42,0" Height="16"/>
            <ComboBox Grid.Row="22" Grid.Column="6" Margin="0,0,0,10" ItemsSource="{Binding Postes}" DisplayMemberPath="POST" SelectedValuePath="IDPOSTE" SelectedValue="{Binding CandidatClient.IdPoste, Mode=TwoWay}" />
            <TextBox Grid.Row="24" Grid.Column="6" AcceptsReturn="True" Text="{Binding Candidat.REMARQUE, Mode=TwoWay, ValidatesOnExceptions=True}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Grid.ColumnSpan="3" Grid.RowSpan="7" MinWidth="250" Margin="0,0,0,16" Width="200"/>
            <ct:Label Style="{StaticResource FormLabelStyle}" Grid.Row="24" Content="Test technique(*)" Margin="40,2,4,0" Height="16"/>
            <ComboBox Grid.Row="24" Grid.Column="2" Margin="1,0,27,10"  ItemsSource="{Binding TestsPractice, UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="TEST_INTITULE" SelectedValuePath="ID_TEST" SelectedValue="{Binding CandidatClient.Id_Test, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding Test, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="26" Content="Projet visé(*)" Margin="40,0,0,11" Height="16" VerticalAlignment="Bottom"/>
            <ComboBox Grid.Row="26" Grid.Column="2" Margin="1,4,27,5" ItemsSource="{Binding Projets}" DisplayMemberPath="PROJET1" SelectedValuePath="IDPROJET" SelectedValue="{Binding CandidatClient.IdProjet, Mode=TwoWay}" />
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="24" Grid.Column="5" Content="Remarques" Margin="0,0,42,0" Height="16"/>
            
            <sdk:Label Style="{StaticResource FormLabelStyle}" Grid.Row="28" Content="GCM estimé(*)" Margin="40,4,4,0" Height="16"/>
            <ComboBox Grid.Row="28" Grid.Column="2" ItemsSource="{Binding GcmCollec}" SelectedValue="{Binding CandidatClient.GCM_ESTIMEE_RH, Mode=TwoWay}"   Margin="1,6,27,5" />


            <sdk:Label Style="{StaticResource FormLabelStyle}"  Grid.Row="5" Grid.Column="5" Content="Niveau Etudes(*)" Margin="0,1,42,0" Height="16"/>
            <ComboBox Grid.Row="5" Grid.Column="6" ItemsSource="{Binding NiveauxEtudes}"  DisplayMemberPath="INTITULE" SelectedValuePath="ID_ETUDE" SelectedValue="{Binding Candidat.ID_ETUDE, Mode=TwoWay}"  Margin="0,2,0,8" />

          
            <HyperlinkButton Content="Visualiser" Visibility="{Binding UpdateVisibility}" HorizontalAlignment="Left" Margin="65,4,0,0" Grid.Row="14" VerticalAlignment="Top" Command="{Binding VisualiserCommand}" Width="63" />
           
            <!-- Tags text Drag And DROP -->
            <sdk:Label Margin="16,0,0,0" Content="Tags" Grid.Row="30" Grid.Column="0" FontStyle="Italic" FontWeight="ExtraBold" Foreground="{StaticResource AtosBlue}"/>
            <TextBox Text="{Binding SearchTagsTxt, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="30" Grid.Column="2" Height="25" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="SelectionChanged">
                        <i:InvokeCommandAction Command="{Binding RechercheTagsCommand, Mode=OneWay}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </TextBox>
            <Grid Grid.Row="31" Grid.Column="1" Grid.ColumnSpan="7" Grid.RowSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.4*" />
                    <ColumnDefinition Width="0.2*"/>
                    <ColumnDefinition Width="0.4*"/>
                </Grid.ColumnDefinitions>
                <toolkit:ListBoxDragDropTarget Grid.Row="0" Grid.Column="0" AllowDrop="true"
                                               HorizontalContentAlignment="Stretch" Height="100" VerticalAlignment="Top">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Drop">
                            <i:InvokeCommandAction Command="{Binding ajoutTagCommand, Mode=OneWay}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <ListBox ItemsSource="{Binding TagsTrouves,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" 
                             ItemTemplate="{StaticResource PhotographTemplate}" Background="AliceBlue"                            
                             >
                        <!-- Style="{StaticResource WrapListBox}" -->
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel Orientation="Horizontal" CanHorizontallyScroll="False" CanVerticallyScroll="True"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                    </ListBox>
                </toolkit:ListBoxDragDropTarget>

                <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1"  HorizontalAlignment="Center">
                    <Image Source="../../Assets/icons/Navigate_right_Icon_16.png" Width="16" Height="16" />
                    <Image Source="../../Assets/icons/Navigate_right_Icon_16.png" Width="16" Height="16" />
                    <Image Source="../../Assets/icons/Navigate_right_Icon_16.png" Width="16" Height="16" />
                    <Image Source="../../Assets/icons/Navigate_right_Icon_16.png" Width="16" Height="16" />
                </StackPanel>

                <toolkit:ListBoxDragDropTarget  Grid.Row="0" Grid.Column="2" AllowDrop="true" 
                                                HorizontalContentAlignment="Stretch"  Height="100" VerticalAlignment="Top">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Drop">
                            <i:InvokeCommandAction Command="{Binding supressionTagCommand, Mode=OneWay}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <ListBox ItemsSource="{Binding SelectedTags,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Height="80"
                             ItemTemplate="{StaticResource PhotographTemplate}"                             
                             Background="GreenYellow"
                             >
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel Orientation="Horizontal" CanHorizontallyScroll="False" CanVerticallyScroll="True"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                    </ListBox>
                </toolkit:ListBoxDragDropTarget>
            </Grid>
            <!-- Buttons Ajouter,Retour -->
            <Grid Grid.Row="33" Grid.Column="1" Grid.ColumnSpan="6">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <HyperlinkButton Grid.Row="0" Grid.Column="2"  
                                Width="130" Height="55" Style="{StaticResource ButtonStyle}"  
                                 Command="{Binding AddCandidatCommand}" TargetName="ContentFrame" >
                    <HyperlinkButton.Content>

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding TextButton}"  TextAlignment="Center" Height="55" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                        </StackPanel>
                    </HyperlinkButton.Content>
                </HyperlinkButton>
                <HyperlinkButton Grid.Row="0" Grid.Column="0" Width="130" Height="55" Style="{StaticResource ButtonStyle}"
                                 TargetName="ContentFrame"  NavigateUri="/ListeCandidats" Foreground="#0066A1"
                                >
                    <HyperlinkButton.Content>

                        <StackPanel Orientation="Horizontal">
                            <Image Source="../../Assets/icons/Arrow-Back.png" VerticalAlignment="Top" Width="30" Height="40"/>
                            <Border Width="10" />
                            <TextBlock Text="Retour" TextAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="55"/>
                        </StackPanel>
                    </HyperlinkButton.Content>
                </HyperlinkButton>
            </Grid>

        </Grid>




    </Grid>
</sdk:Page>